﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.CQ.TLRMYY
{
    /// <summary>
    /// ShuHouFangShiCtrl.xaml 的交互逻辑
    /// </summary>

    public partial class ShuHouFangShiCtrl : CustomCommonTableCtrl
    {
        public ShuHouFangShiCtrl()
        {
            InitializeComponent();
            IniteRadioBation();
            this.Loaded += ShuHouFangShiCtrl_Loaded;
        }

        private void ShuHouFangShiCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.IsNotNeedSaveData = false;
        }
        private void IniteRadioBation()
        {
            new RadioButtonHelper().ChangeRadioSatus(smtzwd, smtzbwd);
            new RadioButtonHelper().ChangeRadioSatus(ysqc, ysbqc);
            new RadioButtonHelper().ChangeRadioSatus(hxzc, hxkn);
            new RadioButtonHelper().ChangeRadioSatus(xhwd, xhbwd);
            new RadioButtonHelper().ChangeRadioSatus(fbw, fby);
            new RadioButtonHelper().ChangeRadioSatus(cgw, cgy);
            new RadioButtonHelper().ChangeRadioSatus(dtw, dty);
            new RadioButtonHelper().ChangeRadioSatus(exotw, exoty);
            new RadioButtonHelper().ChangeRadioSatus(qmjlzc, qmjlyc);
            new RadioButtonHelper().ChangeRadioSatus(ccbww, ccbwy);
            new RadioButtonHelper().ChangeRadioSatus(nzlw, nzly);
            new RadioButtonHelper().ChangeRadioSatus(ttw, tty);
            new RadioButtonHelper().ChangeRadioSatus(zgnexotw, zgnexety);
            new RadioButtonHelper().ChangeRadioSatus(zgnjlzc, zgnjlyc);
            new RadioButtonHelper().ChangeRadioSatus(zgnsxzc, zgnsxyc);
            new RadioButtonHelper().ChangeRadioSatus(mzxgy, mzxgh, mzxgc);
            
        }

        private void CustomTextCtrl_GotFocus(object sender, RoutedEventArgs e)
        {
           
            CustomTextCtrl cutext = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePickerWin = new CusDatePickerWin();
            cusDatePickerWin.SelectedDateTime = DateTime.Now;
            cusDatePickerWin.ShowDialog();
            if (cusDatePickerWin.Result)
            {
                cutext.Value = cusDatePickerWin.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMD_CN);
            }

        }
    }
}
